import * as OpenApi from '@alicloud/openapi-client';
import { getConfig } from '@libs/common/utils';

const { DD } = getConfig();

export class DingClientService {
  /**
   * 使用 Token 初始化账号Client
   * @return Client
   * @throws Exception
   */
  protected createClient(option?: OpenApi.Config) {
    const config = new OpenApi.Config({
      protocol: 'https',
      regionId: 'central',
      accessKeyId: DD.DD_AppKey,
      accessKeySecret: DD.DD_AppSecret,
      ...option,
    });

    return config;
  }
}
